<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>文章管理</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="stylesheet" href="__PUBLIC__/Superadmins/css/reset.css">
    <link rel="stylesheet" href="__PUBLIC__/Superadmins/css/style.css">
    <script src="__PUBLIC__/Superadmins/js/jquery-1.11.1.min.js"></script>
    <script src="__PUBLIC__/Superadmins/js/admin.js"></script>
    <script>
    $(function(){
        if("{$get_data['category']}" != ""){
        	$("#category").val("{$get_data['category']}");
        }
        if("{$get_data['time']}" != ""){
        	 $("#time").val("{$get_data['time']}");
        }
    });
   	
    </script>
</head>

<body>
<input type="hidden" id="deleteUrl" name="deleteUrl" value="__URL__/deleteArticle"/>
<input type="hidden" id="updateUrl" name="updateUrl" value="__URL__/updateArticle"/>
<input type="hidden" id="addUrl" name="addUrl" value="__URL__/addArticle"/>
<input type="hidden" id="ajaxUrl" name="ajaxUrl" value="__URL__/ajaxArticle"/>

    <div class="content">
        <div class="search">
        	<form action="__CONTROLLER__/index" type="get" name="search" id="search_form">
        	<input type="hidden" name="type" value="{$get_data['type']}">
            <div class="search-box">
               <input type="hidden" name="school_id" value=""/>
                <input type="text"  name="school_name" value="{$get_data['school_name']}" class="input_tips" placeholder= "输入您要编辑文章所在学校名称" >
                <input type="text" name="title" value="{$get_data['title']}" placeholder= "输入您要编辑的文章标题" >
                <input type="submit" value="">
                <ul class="input_tips_box" style="z-index:1;display:none;height:160px;overflow:hidden;margin-left: 360px;text-align: left;padding: 5px 2px 5px 10px;background-color: #DDD;width: 188px;">
                </ul>
            </div>
            <div class="match-box">
                <div class="match-item match-item-double">
                    <span>文章类型：</span>
                    <select name="category" id="category">
                        <option value="0">不限</option>
                        <option value="GZ">高招</option>
                        <option value="YZ">研招</option>
                        <option value="YK">艺招</option>
                    </select>
                </div>
                <div class="match-item match-item-double">
                    <span>发布时间：</span>
                    <select name="time" id="time">
                        <option value="0">不限</option>
                        <option value="1">最近一天</option>
                        <option value="3">最近三天</option>
                        <option value="7">最近一周</option>
                        <option value="30">最近一月</option>
                        <option value="365">一年以内</option>
                    </select>
                </div>
            </div>
            </form>
        </div>
        <div class="biaoge">
            
            <table class="article-content">
                <tr>
                    <th width="60%">标题</th>
                    <th width="10%">文章类别</th>
                    <th width="10%">所属学校</th>
                    <th width="10%">发布时间</th>
                    <th width="10%">管理</th>
                </tr>
                <volist name="document_data" id="vo">
						<tr>
							<td>{$vo.title}</td>
							<td>{$vo.category}</td>
							<td>{$vo.school_name}</td>
							<td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
							<td>
								<input type="hidden" name="id" value="{$vo.id}"/>
								<a href="javascript:;" class="btn-article-back">恢复</a> | <a href="javascript:;" class="btn-delete-remove">删除</a>
							</td>
						</tr>
					</volist>
                
              
            </table>
             <div class="m-page"> <a href="__URL__/index/type/{$get_data['type']}/p/1">首页</a>
                {$page}
                <span class="page-jump">
                    <form action="__URL__/index/type/{$get_data['type']}" >
                    <input name="p" type="text">
                    <input type="submit" value="GO">
                    </form>
                </span>
            </div>
        </div>
    </div>
    <div id="modal">
        <div class="modal-overlay"></div>
        <div class="modal-box" id="modal-article">
            <form action="__URL__/addArticle" method="POST" name="">
           	 <input type="hidden" name="type" value="{$get_data['type']}">
           	  <input type="hidden" name="article_id" id="modal_article_id" value="">
                <div class="modal-header">
                    <h2>文章管理</h2> 
                </div>
                <div class="modal-content">
               	 <div id="update-hide">
              		 <label for="article-summary">发布至：</label>
                    <input type="hidden" name="school_id" id="modal_school_id" value="1"/>
                    <input type="text" name="school_name" id="modal_school_name" class="input_tips" placeholder="请选择学校" value="">
                    <ul class="input_tips_box" style="z-index:1;display:none;height:160px;overflow:hidden;right:482px;top:35px;text-align: left;padding: 5px 2px 5px 10px;background-color: #DDD;width: 188px;">
              		 </ul>
                  	<label for="article-type">文章类型：</label>
                    <select name="category" id="modal_category" style="width:100px">
                        <option value="GZ">高招</option>
                        <option value="YZ">研招</option>
                        <option value="YK">艺招</option>
                    </select>
                    </div>
                    <label for="article-title">标题：</label>
                    <input type="text" name="title" id="article-title" placeholder="请填写文章标题" value="">
                    <label for="article-summary">摘要：</label>
                    <input type="text" name="description" id="article-summary" placeholder="" value="">
                    <label for="article-content">内容：</label>
                    <textarea name="content" id="article-content" value=""></textarea>
                </div>
                <div class="modal-footer">
                    <a class="btn-cancel modal-btn">取消</a>
                    <input type="submit" value="确定" class="btn-submit-2 modal-btn">
                </div>
            </form>
        </div>
    </div>
  <!--配置文件--> 
    <script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
     <!--编辑器源码文件--> 
    <script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
   
    <script>
        moduleArticle();
        $('.input_tips').on('paste', function() {
               // var $that =  $(this);
               //getlist($that);
        }).on('keyup', function(event) {
                var $that =  $(this);
                getlist($that);
        }).on('blur', function(event) {
        }).on('focus', function(event) {
        	 var $that =  $(this);
        	 getlist($that);
           $(this).parent().find('ul.input_tips_box').show();
        });
        $('.input_tips_box').on('click','.chenge',function() {
    		//alert($(this).attr('alt') + $(this).attr('title'));
			$(this).closest('div').find("input[name=school_name]").val($(this).attr('title'));
			$(this).closest('div').find("input[name=school_id]").val($(this).attr('alt'));
			$(this).closest('div').find('ul.input_tips_box').hide();
    	});
        function getlist($that){
			var school_name=$that.val();
			var html =  '';
			$.ajax({
				url:'__URL__/getSchoolName',
				async:false,
				type:'GET',
				data:{'school_name':school_name},
				dataType:'json',
					success: function(data){
						if(data != null){
							var j=1;
							$.each(data,function(i,n){ 
								if(j<6){
									html+="<li><a href='javascript:void(0)' class='chenge' alt='"+i+"' title='"+n+"'>"+n+"</a></li>";  
								}
								j++;
							 }); 
						}
						
					}
				})
			$that.parent().find('ul.input_tips_box >li').remove();	
        	$that.parent().find('.input_tips_box').append(html);
        }
    </script>
</body>

</html>
